package com.trkj.dao.jpa;

import java.math.BigDecimal;
import java.util.List;

import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import com.trkj.pojos.CcArrange;

public interface CcArrangeDAO extends CrudRepository<CcArrange, Long> {
	@Query("select c from CcArrange c where c.adoctorid=?1 or c.arrdoctorrid=?2  order by c.fixdate desc")
	public List<CcArrange> findBypdid(Pageable pageable,BigDecimal adoctorid,BigDecimal adoctorid2);
	@Query("select count(*) from CcArrange c where c.adoctorid=?1 or c.arrdoctorrid=?2")
	public long findByConut(BigDecimal adoctorid,BigDecimal adoctorid2);

	@Query("select c from CcArrange c where c.adoctorid=?1 or c.arrdoctorrid=?2 and c.astate=?3 order by c.fixdate desc")
	public List<CcArrange> findByastate(BigDecimal adoctorid,BigDecimal adoctorid2,String astate);
	@Query("select count(*) from CcArrange c where c.adoctorid=?1 or c.arrdoctorrid=?2 and c.astate=?3")
	public long findByConutastate(BigDecimal adoctorid,BigDecimal adoctorid2,String astate);
	@Query("select c from CcArrange c where c.adoctorid=?1 or c.arrdoctorrid=?2 and c.acostid=?3")
	public List<CcArrange> findByacostid(BigDecimal adoctorid,BigDecimal adoctorid2,BigDecimal acostid);
	@Query("select c from CcArrange c where c.adoctorid=?1 and c.arrdoctorrid=?2")
	public List<CcArrange> findByadoctoridOrarrdoctorrid(BigDecimal adoctorid,BigDecimal arrdoctorrid);



}
